<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <title>已申报资质的企业</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>企业澄清审核</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">药品招标管理</a></li>
            <li class="active"><a href="#">投标企业信息管理</a></li>
            <li class="active"><a href="#">企业澄清审核</a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                	<div class="form-group form-group-xs">
                	    <label for="txtDrugName">项目名称：</label>
					    <select class="form-control" style="width:220px;" id="projId" name="projId">
					     <option value="">请选择</option>
					     <c:forEach items="${projList}" var="item">
	                            <option value="${item.projId}" >${item.name}</option>
	                        </c:forEach>	
					    </select>
					    </select>
                	</div>
                    <!-- <div class="form-group form-group-xs">
                        <label for="txtDrugName">企业编号：</label>
                        <input class="form-control" type="text" id="compCode" name="compCode" placeholder="企业编号" />
                    </div> -->
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">企业名称：</label>
                        <input class="form-control" type="text" id="compName" name="compName" placeholder="企业名称" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">企业属性：</label>
                        <select class="form-control" id = "compType">
                        	<option value = ''>请选择</option>
                        	<option value = '1'>生产企业</option>
                        	<option value = '2'>配送企业</option>
                        </select>
                    </div>
                    <button type="button" onclick="gridSerch()" class="btn btn-success btn-sm">查&nbsp;询</button>
                </div>
            </div>
        </div>

        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>

    </section>
    
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script type="text/javascript">
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/bidProject/getCompprofileCompDataList.html",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                shrinkToFit:true,
                height: 270,
                colNames: ['操作','auditStatus','compType','compId','项目名称','企业编号', '企业名称', '所属地区','组织机构代码','企业属性'],
                colModel: [
                    { name: 'operate', width: 80,sortable: false, align:"center",
                    	formatter : function(val, opts, rowdata) {
                    		var str = "";
                    		if( rowdata.curStatus==4 && rowdata.isCurStatusClose==1 ){
                    			if( rowdata.complainEndtime!=null && rowdata.complainStarttime!=null ){
    								if( rowdata.complainStarttime<="${date}" && rowdata.complainEndtime>="${date}" ){
    									str += "<a href='${ctx}/bidProject/toComplainCompprofileAudit.html?projId="+rowdata.projId+"&compId="+rowdata.compId+"&compType="+rowdata.compType+"'; style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat 0px -40px' class='opIcon' title='澄清审核'></a>";
    	                    		}             			
                        		}
                    		}
                    		 
                    		return str;
                    	}	
                    },
                    { name: 'auditStatus', hidden:true,width: 100, align: 'center' ,sortable: false},
					{ name: 'compType', hidden:true,width: 100, align: 'center' ,sortable: false},
					{ name: 'compId', hidden:true,width: 100, align: 'center' ,sortable: false},
					{ name: 'projName', width: 180, align: 'left' ,sortable: false},
                    { name: '', width: 160, hidden:true, align: 'center' ,sortable: false},
                    { name: 'compName', width: 180, align: 'left' ,sortable: false,
                    	formatter:function(cellvalue, options, row){ 
                    		return cellvalue==null?"":"<a href=\"javascript:$.HN.dialog.opendialog('"+cellvalue+"','企业详情','${ctx}/stdCompinfo/toStdCompinfoDetailJsp.html?compCodeDetail="+row.compCode+"','800px','400px',function operResult(val){return operResult;})\">"+cellvalue+"</a>"
                    }},
                    { name: 'areaName', width: 160, align: 'center' ,sortable: false},
                    { name: 'orgCode', width: 160, hidden:true, align: 'center' ,sortable: false},
                    { name: 'compType', width: 170, align: 'center' ,sortable: false,
                    	formatter:function(val,opts,rowdata){
                    		if(rowdata.compType == '1'){
                    			return "生产企业";
                    		}else if (rowdata.compType == '2'){
                    			return "配送企业";
                    		}else {
                    			return "";
                    		}
                    	}	
                    }
                
                ],
                rowNum: 20,
                rowList: [10, 20, 50, 100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "企业列表",
                jsonReader: {
                    repeatitems: false  
                },
                loadComplete: function (data) { //完成服务器请求后，回调函数
                  	var projId = data.form;
                	if(projId!=null && projId!=""){
                	$("#projId").find("option").each(function(){
                			if($.trim($(this).val()) == $.trim(projId)){
                    			$(this).attr("selected",true).parents("#projId").attr("disabled","disabled");
                    			$("#status").find("option[value='1']").attr("selected",true).parents("#status").attr("disabled","disabled");
                    			return;
                    		}
                	 }); 
                  }
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
        //查询
        function gridSerch() {
        	var projId = $("#projId").val();
        	var compName = $("#compName").val();
        	var compType = $("#compType").val();
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{
    	        		"projId":projId,
    	        		"compName":compName,
    	        		"compType":compType		
    	        }
    	    }).trigger("reloadGrid"); //重新载入  
    	}
        
        
    </script>
</body>
</html>